package com.ymatou.query.trading.api.parameter;

import java.util.ArrayList;
import java.util.List;

import com.ymt.core.tool.Logger;
import com.ymttest.common.enums.OrderStatusEnum;

public class OrderStatus {

	/* 根据orderStatus list 里的订单状态，判断是否包含查询付全款状态 */
	public static int GetOrderStatusUsingMethod(List<Integer> orderStatus) {
		int orderStatusUsingMethod = 0;
		if (orderStatus != null && orderStatus.size() > 0) {
			if (orderStatus.contains(OrderStatusEnum.SellerAccept.getValue())
					&& !orderStatus.contains(OrderStatusEnum.OrderPostPay.getValue())) {
				orderStatusUsingMethod = 1;
				orderStatus.remove((Integer) OrderStatusEnum.SellerAccept.getValue());
			} else if (!orderStatus.contains(OrderStatusEnum.SellerAccept.getValue())
					&& orderStatus.contains(OrderStatusEnum.OrderPostPay.getValue())) {
				orderStatus.remove((Integer) OrderStatusEnum.OrderPostPay.getValue());
				orderStatusUsingMethod = 2;
			} else {
				orderStatusUsingMethod = 3;
			}
		}
		return orderStatusUsingMethod;
	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		List<Integer> l = new ArrayList<Integer>();
		l.add(17);
		l.add(3);
		Logger.debug(GetOrderStatusUsingMethod(l));
		Logger.debug(l);
	}

}
